<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>verbose_terminate_handler</title>
<link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../index.html" title="Chapter 1. Boost.Core">
<link rel="up" href="../index.html" title="Chapter 1. Boost.Core">
<link rel="prev" href="use_default.html" title="use_default">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td>
<td align="center"><a href="../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="use_default.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="core.verbose_terminate_handler"></a><a class="link" href="verbose_terminate_handler.html" title="verbose_terminate_handler">verbose_terminate_handler</a>
</h2></div></div></div>
<div class="toc"><dl class="toc"><dt><span class="section"><a href="verbose_terminate_handler.html#core.verbose_terminate_handler.header_boost_core_verbose_termin">Header
      &lt;boost/core/verbose_terminate_handler.hpp&gt;</a></span></dt></dl></div>
<div class="simplesect">
<div class="titlepage"><div><div><h3 class="title">
<a name="idm14903"></a>Authors</h3></div></div></div>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
          Peter Dimov
        </li></ul></div>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="core.verbose_terminate_handler.header_boost_core_verbose_termin"></a><a class="link" href="verbose_terminate_handler.html#core.verbose_terminate_handler.header_boost_core_verbose_termin" title="Header &lt;boost/core/verbose_terminate_handler.hpp&gt;">Header
      &lt;boost/core/verbose_terminate_handler.hpp&gt;</a>
</h3></div></div></div>
<p>
        The header <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">core</span><span class="special">/</span><span class="identifier">verbose_terminate_handler</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code>
        defines the function <code class="computeroutput"><span class="keyword">void</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">core</span><span class="special">::</span><span class="identifier">verbose_terminate_handler</span><span class="special">()</span></code>. Its purpose is to be set as a terminate
        handler as in
      </p>
<pre class="programlisting"><span class="identifier">std</span><span class="special">::</span><span class="identifier">set_terminate</span><span class="special">(</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">core</span><span class="special">::</span><span class="identifier">verbose_terminate_handler</span> <span class="special">);</span>
</pre>
<p>
        When invoked, the function prints information about the current uncaught
        exception to <code class="computeroutput"><span class="identifier">stderr</span></code> and then
        calls <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">abort</span></code>.
      </p>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="core.verbose_terminate_handler.header_boost_core_verbose_termin.synopsis"></a><a class="link" href="verbose_terminate_handler.html#core.verbose_terminate_handler.header_boost_core_verbose_termin.synopsis" title="Synopsis">Synopsis</a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span>
<span class="special">{</span>
<span class="keyword">namespace</span> <span class="identifier">core</span>
<span class="special">{</span>

<span class="special">[[</span><span class="identifier">noreturn</span><span class="special">]]</span> <span class="keyword">void</span> <span class="identifier">verbose_terminate_handler</span><span class="special">();</span>

<span class="special">}</span> <span class="comment">// namespace core</span>
<span class="special">}</span> <span class="comment">// namespace boost</span>
</pre>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="core.verbose_terminate_handler.header_boost_core_verbose_termin.example"></a><a class="link" href="verbose_terminate_handler.html#core.verbose_terminate_handler.header_boost_core_verbose_termin.example" title="Example">Example</a>
</h4></div></div></div>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">core</span><span class="special">/</span><span class="identifier">verbose_terminate_handler</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">throw_exception</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">exception</span><span class="special">&gt;</span>

<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span>
<span class="special">{</span>
    <span class="identifier">std</span><span class="special">::</span><span class="identifier">set_terminate</span><span class="special">(</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">core</span><span class="special">::</span><span class="identifier">verbose_terminate_handler</span> <span class="special">);</span>
    <span class="identifier">boost</span><span class="special">::</span><span class="identifier">throw_with_location</span><span class="special">(</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">exception</span><span class="special">()</span> <span class="special">);</span>
<span class="special">}</span>
</pre>
<p>
          Sample output:
        </p>
<pre class="programlisting"><span class="identifier">std</span><span class="special">::</span><span class="identifier">terminate</span> <span class="identifier">called</span> <span class="identifier">after</span> <span class="identifier">throwing</span> <span class="identifier">an</span> <span class="identifier">exception</span><span class="special">:</span>

      <span class="identifier">type</span><span class="special">:</span> <span class="keyword">class</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">detail</span><span class="special">::</span><span class="identifier">with_throw_location</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">exception</span><span class="special">&gt;</span>
    <span class="identifier">what</span><span class="special">():</span> <span class="identifier">Unknown</span> <span class="identifier">exception</span>
  <span class="identifier">location</span><span class="special">:</span> <span class="identifier">example</span><span class="special">.</span><span class="identifier">cpp</span><span class="special">:</span><span class="number">8</span><span class="special">:</span><span class="number">12</span> <span class="identifier">in</span> <span class="identifier">function</span> <span class="char">'main'</span>
</pre>
</div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2014 Peter Dimov<br>Copyright © 2014 Glen Fernandes<br>Copyright © 2014 Andrey Semashev<p>
        Distributed under the <a href="http://boost.org/LICENSE_1_0.txt" target="_top">Boost
        Software License, Version 1.0</a>.
      </p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="use_default.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a>
</div>
</body>
</html>
